Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaves - Raisah V. #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rvesteinsdottir
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Your methods both work. See my note on time complexity for delete_at.

Excellent job!


# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: The time complexity is O(n) because the algorithms time varies linearly with the length of the list array.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually the time complexity is O(n2) because the delete_at method takes O(n) time. This is because it has to shift all elements to the left one index.

end

# Time Complexity: ?
# Space Complexity: ?
# Time Complexity: The time complexity is O(nm) because in the worst case scenario the time that the algorithm takes can change linearly based on the length of the first string in the array passed AND the length of the array itself.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants